In a video compressing system using DCT typified by MPEG (Moving Pictures Expert Group) standard, a code amount is controlled so that a bit stream is transmitted at a desired rate to a transmission path. For example, by controlling a quantizing index that represents a quantizing step, the code amount is controlled. In a code amount control proposed as TM5 of the MPEG2 standard, using the relation among the remaining amount of a virtual buffer, a quantizing index of a preceding encoding process, and a generated code amount, a quantizing step is fed back.
FIG. 1 shows the structure of layers of the MPEG system. The MPEG system prescribes a hierarchical structure composed of a sequence layer, a GOP (Group Of Picture) layer, a picture layer, a slice layer, and a macro block layer. More practically, as shown in FIG. 1, when a quantizing step is varied with data contained in the slice layer and the macro block layer (this data is referred to as Q scale), the code amount in a fixed period such as one frame is adjusted. For example, in (4:2:0) format, one macro block is composed of four blocks of a luminance signal, one block of a chrominance signal U, and one block of a chrominance signal V.
For example, the Q scale q_scale has 31 values Q1 to Q31. As the Q scale value becomes large, the quantizing step becomes large. As shown in FIG. 2, there is a relation between the quantizing step and total code amount in such a manner that as the quantizing step becomes large, the quantizing process is coarsely performed and the total code amount becomes small and that as the quantizing step becomes small, the quantizing process is finely performed and the total code amount becomes large. In addition, since the quantizing process is performed with discrete values, the total code amount becomes a discrete value.
A conventional application such as a communication uses the relation between a preceding quantizing step and the total code amount so as to feed back the current average rate. In other words, when the current average rate is higher than a target rate, the quantizing step is slightly roughed up and thereby the total code amount is decreased. In contrast, when the current average rate is lower than the target rate, the quantizing step is slightly fined down and thereby the total code amount is increased. In such a manner, a control is performed so that the target rate is averagely accomplished. In other words, although the total code amount is increased and decreased in a short time period, the total code amount averagely becomes the target value in a long time period.
However, in an application such as a VTR (Video Tape Recorder or VCR: Video Cassette Recorder) that is used on the assumption that an editing operation is performed, when the total code amount is controlled only with the average rate, a problem takes place. In such an application, since an editing operation may be performed for each frame, a control is required so that the total code amount in each edit unit should not exceed a predetermined amount. In the following description, such a control is referred to as fixed length code amount control.
Since the forgoing feedback control cannot accomplish the fixed length code amount control, a reproduced picture is fatally deteriorated. Alternatively, with an excessive margin to prevent a code amount from exceeding a target value, the picture quality may be deteriorated. To solve such a problem, a technology for performing a quantizing process using a plurality of fixed quantizers having different quantizing steps and controlling the quantizing process using a total code amount is known. For example, in International Patent Laid Open Publication No. WO96/28937, a feed-forward type code amount control is disclosed.
In reality, quantizers each having 31 Q scales as shown in FIG. 2 are disposed. The total code amount of DCT coefficients quantized by each quantizer is obtained for one frame period (alternatively term “screen” may be used). A Q scale that satisfies conditions of which the total code amount does not exceed the target code amount and of which the difference to the target code amount is small is decided. In the example shown in FIG. 2, Q4 is a Q scale that satisfies such conditions.
However, there is a problem how to decide a quantizing step corresponding to the total code amounts of for example 31 Q scales. Since Q scales are discrete values, bit rate values are also discrete values. Thus, the bit rate cannot be finely controlled. As a result, the difference to the target code amount cannot become sufficiently small.
Therefore, an object of the present invention is to provide a video signal quantizing apparatus and a method thereof that allow a code amount control to be performed corresponding to an activity so that the total code amount does not exceed a target code amount and that the difference between the target code amount and the total code amount becomes small.